# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gedit-code-assistance
pkgver=3.16.0+4+gd19b879
pkgrel=1
pkgdesc="Code assistance for gedit"
url="https://git.gnome.org/browse/gedit-code-assistance"
arch=(i686 x86_64)
license=(GPL3)
depends=(gedit libgee gnome-code-assistance)
makedepends=(intltool gobject-introspection vala git)
groups=(gnome-extra)
_commit=d19b879e421ed43db779f6a26ac460f63c45b463  # master
options=(!makeflags)  # indentbackend build breaks, needs gca.vapi
source=("git://git.gnome.org/gedit-code-assistance#commit=$_commit"
        fix-compile.diff)
sha256sums=('SKIP'
            '7ebfe45ae3abc547af248397bd6a5b5d5063b666cc52f2660977a709d1fa3ec6')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../fix-compile.diff
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package(){
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
